<?php

namespace app\common\model;

use think\Model;
use think\Db;

/**
 * 参团模型
 */
class TeamFollow extends Model
{
    public function user(){
        return $this->belongsTo('User','user_id','id')->setEagerlyType(0);
    }

    public function order(){
        return $this->belongsTo('Order','order_id','id');
    }

    public function teamFound(){
        return $this->belongsTo('TeamFound','found_id','id');

    }

    public function teamActivity(){
        return $this->belongsTo('TeamActivity','team_id','id');
    }

    //状态描述
    public function getStatusTextAttr($value, $data)
    {
        $status = ['0'=>'待拼单','1'=>'拼单成功','2'=>'成团成功','3'=> '成团失败'];
        return $status[$data['status']];
    }

}